package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.xuehua.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GradedAlarmRealMapper;
import com.ruoyi.system.domain.GradedAlarmReal;
import com.ruoyi.system.service.IGradedAlarmRealService;

/**
 * 分级报警实时Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class GradedAlarmRealServiceImpl extends ServiceImpl<GradedAlarmRealMapper, GradedAlarmReal> implements IGradedAlarmRealService //修改
{
    @Autowired
    private GradedAlarmRealMapper gradedAlarmRealMapper;

    /**
     * 查询分级报警实时
     * 
     * @param gradedAlramRealId 分级报警实时主键
     * @return 分级报警实时
     */
    @Override
    public GradedAlarmReal selectGradedAlarmRealByGradedAlramRealId(String gradedAlramRealId)
    {
        return gradedAlarmRealMapper.selectGradedAlarmRealByGradedAlramRealId(gradedAlramRealId);
    }

    /**
     * 通过区域和传感器类型来查询分级报警实时
     *
     * @return 分级报警实时
     */
    @Override
    public GradedAlarmReal selectGradedAlarmRealByBaseStationAndSensorTypeAndAlarmType(String baseStationName, String sensorTypeName,String alarmTypeName) {
        return gradedAlarmRealMapper.selectGradedAlarmRealByBaseStationAndSensorTypeAndAlarmType(baseStationName,sensorTypeName,alarmTypeName);
    }

    /**
     * 通过区域和传感器类型来查询分级报警实时
     *
     * @return 分级报警实时
     */
    @Override
    public GradedAlarmReal selectGradedAlarmRealByBaseStationAndSensorType(String baseStationName, String sensorTypeName) {
        return gradedAlarmRealMapper.selectGradedAlarmRealByBaseStationAndSensorType(baseStationName,sensorTypeName);
    }

    /**
     * 查询分级报警实时列表
     * 
     * @param gradedAlarmReal 分级报警实时
     * @return 分级报警实时
     */
    @Override
    public List<GradedAlarmReal> selectGradedAlarmRealList(GradedAlarmReal gradedAlarmReal)
    {
        return gradedAlarmRealMapper.selectGradedAlarmRealList(gradedAlarmReal);
    }

    /**
     * 新增分级报警实时
     * 
     * @param gradedAlarmReal 分级报警实时
     * @return 结果
     */
    @Override
    public int insertGradedAlarmReal(GradedAlarmReal gradedAlarmReal)
    {
        gradedAlarmReal.setGradedAlramRealId(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        return gradedAlarmRealMapper.insertGradedAlarmReal(gradedAlarmReal);
    }

    /**
     * 修改分级报警实时
     * 
     * @param gradedAlarmReal 分级报警实时
     * @return 结果
     */
    @Override
    public int updateGradedAlarmReal(GradedAlarmReal gradedAlarmReal)
    {
        return gradedAlarmRealMapper.updateGradedAlarmReal(gradedAlarmReal);
    }

    /**
     * 批量删除分级报警实时
     * 
     * @param gradedAlramRealIds 需要删除的分级报警实时主键
     * @return 结果
     */
    @Override
    public int deleteGradedAlarmRealByGradedAlramRealIds(String[] gradedAlramRealIds)
    {
        return gradedAlarmRealMapper.deleteGradedAlarmRealByGradedAlramRealIds(gradedAlramRealIds);
    }

    /**
     * 删除分级报警实时信息
     * 
     * @param gradedAlramRealId 分级报警实时主键
     * @return 结果
     */
    @Override
    public int deleteGradedAlarmRealByGradedAlramRealId(String gradedAlramRealId)
    {
        return gradedAlarmRealMapper.deleteGradedAlarmRealByGradedAlramRealId(gradedAlramRealId);
    }
}
